package cn.edu.bupt.ch10_1.msinventory.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/production")
public class InventoryController {
    @GetMapping("/deduct/{product_uuid}/{num}")
    public String deduct(@PathVariable("product_uuid") String product_uuid,
                         @PathVariable("num") String num,
                         HttpServletRequest request){
        return "product_uuid:" + product_uuid + " is deduct success, server port: "
                + request.getServerPort();
    }
}
